<script type="text/javascript">
	var records = '{$feedbacks|count}';
     $(document).ready(function() {
           $('#pager').smartpaginator({ 
               totalrecords: records, 
               recordsperpage: 10, 
               initval:0 , 
               next: 'Next', 
               prev: 'Prev', 
               first: 'First', 
               last: 'Last', 
               theme: 'green',
               datacontainer: 'chat', 
               dataelement: 'tr',
               display:'single'
         });
     });
 </script>
<img
	src="{$smarty.const.WEBROOT}/lib/design/img/logo_{$business->getCode()}.png" width="140" height="140"
	alt="{$business->getName()} logo" class="left photo"/>
<h1 style="padding-top:30px">{$business->getName()}</h1>
<h1 style="color:gray;">{$nps|string_format:"%.1f"}%</h1>
<p style="clear:left;">{$business->getDescription()}</p>
<div id="map-canvas" style="height:200px;width:450px;float:left"></div>
<div style="float: left;">
<table class="feedbackTbl" cellspacing="0" style="width:300px">
<tr><td>{$lang['address']}</td><td>{$business->getAddress()}</td></tr>
<tr><td>{$lang['phone']}</td><td>{$business->getPhone()}</td></tr>
<tr><td colspan='2'><a href='{$business->getWebsite()}' target='_blank'>{$lang['website']}</a></td></tr>
</table><br>
<p class="readmore">
	<a
		href="{$smarty.const.WEBROOT}/feedback/{$business->getCode()}/">{$lang['feedback']}</a>
	»
</p>
{if isset($company) && $company}
	{foreach from=$company item=c}
	{if $c->getId() eq $business->getId()}
    <p class="readmore">
    	<a href="{$smarty.const.WEBROOT}/editCompany/{$c->getId()}">{$lang['editDetails']}</a> »
    </p>
    {/if}
	{/foreach}
{/if}
</div>
<div class="clearfix"></div>
<h3>{$lang['clientFeedback']}</h3>
{if $business->getPublicComments() eq 1}
	{if $feedbacks}
	    <div class="chat" id="chat">
	    <table>
	    	{foreach from=$feedbacks item=feedback}
	    	<tr><td>
	    	<div class="bubble me" id="feedback_{$feedback->getId()}">
	    	    <span class="fade" style="float:left;">{$feedback->getTime()|date_format:"%d.%m.%Y"}</span>
	    	    {if $feedback->getInappropriate() eq 0}
	    	    <div class="ui-state-default ui-corner-all" title="{$lang['report']}" style="float: right;"><span class="ui-icon ui-icon-notice" onclick="$('#iadiv_{$feedback->getId()}').toggle('slow')"></span></div>
	    	    {/if}
	    	    {if isset($loggedUser) && $loggedUser}
		    	    {if $loggedUser->getType() eq 1}
		    	    	<div class="ui-state-default ui-corner-all" title="{$lang['delete']}" style="float: right;margin-right:5px"><span class="ui-icon ui-icon-trash" onclick="deleteComment('{$feedback->getId()}')"></span></div>
		    	    {/if}
	    	    {/if}
	    	    <br>
	    	    <p> {$feedback->getComment()}</p>
	    	    
	    	    <div id="iadiv_{$feedback->getId()}" style="clear:both;display:none;">
	    	    	{$lang['reason']}:<br>
	    	    	<textarea id="iafb_{$feedback->getId()}" class="feedbackInput textareaHeight inputWidth" style="width:100%;height:60px"></textarea>
	    	    	<br><br>
	    	    	<p class="readmore"><a href="#feedback_{$feedback->getId()}" onclick="flagInappropriate('{$feedback->getId()}')">{$lang['doneBtn']}</a> »</p>
	    	    	<p class="readmore"><a href="#feedback_{$feedback->getId()}" onclick="$('#iadiv_{$feedback->getId()}').toggle('slow')">{$lang['cancelBtn']}</a> »</p>
    	    	</div>
	    	</div>
	    	</td></tr>
	    	{/foreach}
    	</table>
	    </div>
	<div id="pager" style="margin: auto;"></div>	    
	{/if}
{else}
	<p>{$lang['commentsPrivate']}</p>
{/if}
